<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加员工</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
</head>
<body>
<div class="container">
    <header class="header">
        <h1>员工管理系统</h1>
        <div class="user-info">
            欢迎, ${loggedInUser.username}!
            <a href="${pageContext.request.contextPath}/employees" class="btn btn-secondary">返回列表</a>
            <a href="${pageContext.request.contextPath}/logout" class="btn btn-secondary">退出登录</a>
        </div>
    </header>

    <main class="main-content">
        <h2>添加员工</h2>

        <form method="post" action="${pageContext.request.contextPath}/employees" class="employee-form">
            <input type="hidden" name="action" value="add">

            <div class="form-group">
                <label>姓名:</label>
                <input type="text" name="name" required>
            </div>

            <div class="form-group">
                <label>部门:</label>
                <input type="text" name="department" required>
            </div>

            <div class="form-group">
                <label>职位:</label>
                <input type="text" name="position" required>
            </div>

            <div class="form-group">
                <label>薪资:</label>
                <input type="number" name="salary" step="0.01" required>
            </div>

            <div class="form-group">
                <label>邮箱:</label>
                <input type="email" name="email">
            </div>

            <div class="form-group">
                <label>电话:</label>
                <input type="text" name="phone">
            </div>

            <div class="form-group">
                <label>入职日期:</label>
                <input type="date" name="hireDate" required>
            </div>

            <div class="form-actions">
                <button type="submit" class="btn btn-primary">添加</button>
                <a href="${pageContext.request.contextPath}/employees" class="btn btn-secondary">取消</a>
            </div>
        </form>
    </main>
</div>
</body>
</html>